package com.wql.aaa.controller;

import com.wql.aaa.entity.AliPay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import sun.management.counter.perf.PerfInstrumentation;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/15 10:07
 */
@RestController
@RequestMapping("/user")
public class HelloController {
    @GetMapping("/user")
    public Map index() {
        Map map = new HashMap();
        map.put("name", "吴少聪");
        map.put("age", 19);
        return map;
    }
    @Autowired
    private AliPay aliPay;
    @GetMapping("/alipay")
    public AliPay alipay(){
        return aliPay;
    }
    @Value("${server.port}")
    private Integer port;

    @Value("${student.name}")
    private String name;
    @GetMapping("/haha")
    public String haha(){
        return "端口号"+ port+"姓名"+name;
    }
}
